<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<title>导入</title>
<link th:replace="common/header"/>
</head>
<body class="no-skin">
	<div th:replace="common/top"/>
	<div class="main-container ace-save-state" id="main-container">
		<div th:replace="common/menu"/>
		<div class="main-content">
			<div class="main-content-inner">
				<div th:replace="common/title"/>
				<div class="page-content">
					<div th:replace="common/skin"/>
					<div class="row">
						<div class="col-xs-12">
							<!-- PAGE CONTENT BEGINS -->
							<form class="form-horizontal" action="add.do" name="form" th:action="@{/houseInfo/import}" th:method="post" enctype="multipart/form-data">
								<h3 class="header smaller lighter blue"><i class="fa fa-file-archive-o" aria-hidden="true"></i>上传Excel</h3>
								<div class="row-fluid">
								<!--PAGE CONTENT BEGINS HERE-->
									<div class="span8">
										<div class="control-group">
											<label class="control-label" for="img">上传文件:<font style="color:red">*</font></label>
											<div class="controls">
												<input type="file" name="file" id="file" onchange="check(this);" class="input_fix"/>
											</div>
										</div>
									</div>
									<div class="span4">
										<div class="control-group">
											<font style="color:red"><p th:text="${msg}">Name Error</p>&nbsp;</font>
										</div>
									</div>
								</div>
								<div class="row-fluid">
									<div class="text-center span12">
										<button shiro:hasPermission="/houseInfo/import" class="btn btn-primary" type="submit"><i class="fa fa-floppy-o" aria-hidden="true"></i>提交</button>
										<button shiro:hasPermission="/houseInfo/import" class="btn btn-danger" type="reset"><i class="fa fa-times" aria-hidden="true"></i>取消</button>
										<a shiro:hasPermission="/houseInfo/getall" class="btn" href="getall" th:href="@{/houseInfo/getall}"><i class="fa fa-reply" aria-hidden="true"></i>返回</a>
									</div>
								</div>
							</form> 
							<!-- PAGE CONTENT ENDS -->
						</div><!-- /.col -->
					</div><!-- /.row -->
				</div><!-- /.page-content -->
			</div>
		</div><!-- /.main-content -->
		<div th:replace="common/footer"/>
	</div><!-- /.main-container -->
	<div th:replace="common/buttom"/>

	<script type="text/javascript">
		function check(obj){ 
			var v = obj.value.substr(obj.value.length - 3);
			v = v.toLowerCase(); 
			if("xls" != v){
				showTip('提示','文件类型必须是*.xls', 4000);
				var fileobj = document.getElementById(obj.id); 
				fileobj.outerHTML = fileobj.outerHTML; 
				return false;
			}
		} 
		
		$("form").submit(function(){  
			$(":submit",this).attr("disabled","disabled");  
		}); 
	</script>
</body>
</html>
